<%@ page pageEncoding="UTF-8" import="com.baosight.efmpx.cw.cr.business.SWHelp,
com.baosight.efmpx.cw.cr.domain.Warn,com.baosight.efmpx.system.service.factory.PubServiceFactory,com.baosight.efmpx.system.service.ad.UserService,
com.baosight.efmpx.system.service.ad.IGroup,com.baosight.efmpx.system.util.SessionUtil,
java.util.List,
java.util.ArrayList"%>
<%@ taglib prefix="spes" tagdir="/WEB-INF/tags" %>
<%@ taglib prefix="efmpx" uri="/WEB-INF/spesButton/spesButton.tld" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@page import="com.baosight.iplat4j.core.ei.EiInfo"%>
<%@page import="com.baosight.efmpx.cw.cr.business.SWFileDealRight"%>
<%@page import="com.baosight.efmpx.cw.cr.business.SWFileKind"%>
<c:set var="ctx" value="${pageContext.request.contextPath}" />
<c:set var="listUrl" value="${ctx }/DispatchAction.do?serviceName=CWCRFile"/>
<c:set var="commentUrl" value="${ctx }/DispatchAction.do?serviceName=CWCRUsualComment"/>
<c:set var="subFileGuid" value="${ei.attr.subFileGuid}"/>
<link href="${ctx}/CW/CR/images/style.css" rel="stylesheet" type="text/css">

<c:set var="file" value="${ei.attr.file}"/>
<c:set var="fileter" value="${ei.blocks.i.rows[0]}"/>
<c:set var="fileKind" value="${file.fileKind1}" />
<c:set var="parentFileGuid" value="${file.parentFileGuid}" />
<c:set var="SWFileDealRight" value="${ei.attr.SWFileDealRight}"/>
<c:set var="parentFileKind" value="${ei.attr.parentFileKind}"/>


<%

UserService userService = PubServiceFactory.getAdUserService();
IGroup group =userService.getDefaultGroup(SessionUtil.getCurrentUserLabel(), null);
String groupLabel = group.getGroupLabel();
//获取公文订单页面
String fileKind = (String)pageContext.getAttribute("fileKind");
String efFormEname1 =SWFileKind.getformPage(fileKind);
if(efFormEname1!=null) {
	pageContext.setAttribute("efFormEname1", efFormEname1);
}
else {
	pageContext.setAttribute("efFormEname1", "");
}
//获取待处理页面中的公文详细页面
String efFormEname2=SWFileKind.getDetailPage2(fileKind);
if(efFormEname2!=null) {
	pageContext.setAttribute("efFormEname2", efFormEname2);
}
else {
	pageContext.setAttribute("efFormEname2", "");
}


%>
<body leftmargin="0" topmargin="0">
<div id="pages_2">
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr> 
    <td align="center" valign="top">
    
	<table width="100%"  border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td nowrap="nowrap"><div id="sbnav"><img src="${ctx }/EFMPX/CSS/images/ico_22.gif"  class="sbnav_img" />您现在所在的位置：<%@ include file="/EFMPX/location.jsp"%></div></td>
        </tr>
    </table>
    <form id=CRFL06 method=post action="">
		<input type="hidden" id="i-0-taskId" name="i-0-taskId" value="${fileter.taskId}"/>
		<input type="hidden" id="i-0-fileKind1" name="i-0-fileKind1" value="${file.fileKind1}"/>
		<input type="hidden" id="i-0-fileGuid" name="i-0-fileGuid" value="${file.fileGuid}"/>
       <table width="100%" border="0" cellpadding="4" cellspacing="1" >
     	 <tr>
	        <td>
	        	<c:if test="${file.fileKind1 eq 'SendFile' }">
		        	<spes:cwcrfile coloumn_id="${file.title}#,${file.ngDept}#, ${file.fileCatCN}#,${file.ngDate}#, ${file.fileCode2}" coloumn_name="文件标题,拟稿部门,发文类型,拟稿日期,文件编号" fileGuid="${file.fileGuid}"/>
			 	</c:if>
	        	<c:if test="${file.fileKind1 eq 'ReceiveFile' }">
		        	<spes:cwcrfile coloumn_id="${file.title}#, ${file.fileSource}#, ${file.fileCode}#, ${file.ngDate}#, ${file.fileCode2}" coloumn_name="文件标题,来文单位,收文号,登记日期,文件编号" fileGuid="${file.fileGuid}"/>
			 	</c:if>
			 	<c:if test="${file.fileKind1 eq 'SignFile' }">
		        	<spes:cwcrfile coloumn_id="${file.title}#,${file.ngDept}#, ${file.fileCatCN}#,${file.ngDate}" coloumn_name="文件标题,拟稿部门,文件类别,拟稿日期" fileGuid="${file.fileGuid}"/>
			 	</c:if>
			 	<c:if test="${file.fileKind1 eq 'DeptReceiveFile' }">
		        	<spes:cwcrfile coloumn_id="${file.title}#,${file.fileSource}#, ${file.fileCode2}#,${file.ngDate}" coloumn_name="文件标题,来文单位,文件编号,登记日期" fileGuid="${file.fileGuid}"/>
			 	</c:if>
			 	<c:if test="${file.fileKind1 eq 'DeptSendFile' }">
		        	<spes:cwcrfile coloumn_id="${file.title}#,${file.ngDept}#,${file.fileCatCN}#,${file.ngDate}" coloumn_name="文件标题,拟稿部门,发文类型,拟稿日期" fileGuid="${file.fileGuid}"/>
			 	</c:if>
			 	<c:if test="${file.fileKind1 eq 'ReMeettingFile' }">
		        			<spes:cwcrfile coloumn_id="${file.title}#, ${file.ngDept}#, ${file.ngDate}#, ${file.fileCode2}" coloumn_name="文件标题,拟稿部门,拟稿日期,文件编号" fileGuid="${file.fileGuid}"/>
				</c:if>
			 	
				<spes:cwcrcommentList fileGuid="${file.fileGuid}"/>
				
				<spes:cwcrcommentContent id="i-0-commentContent" name="i-0-commentContent" taskId="${fileter.taskId}"/>
	          	
	          	<spes:crcwnext taskId="${fileter.taskId}" fileKind="${file.fileKind1}" fileKind2="${file.fileKind2}"/>

			    <table border="0" cellspacing="0" cellpadding="0" > 
			    	<tr>
			    		<td height="5"></td>
			    	</tr>
			    </table>
       			<table border="0" cellspacing="0" cellpadding="0" align="right" > 
       				<tr align="right">
       					<td>
       					<a href='#' class='easyui-linkbutton' iconCls='icon-remove' onclick="doNext()">流转</a>
       				    <a href='#' class='easyui-linkbutton' iconCls='icon-save' onclick="queryWF('${file.fileGuid}')">流程跟踪</a>
       				    <a href='#' class='easyui-linkbutton' iconCls='icon-detail' onclick="doQuery('${file.fileGuid}')">详细信息</a>
       				    <a href='#' class='easyui-linkbutton' iconCls='icon-print' onclick="doPrint('${file.fileGuid}')">生成处理单</a>
       				    <a href='#' class='easyui-linkbutton' iconCls='icon-cancel' onclick="doBack()">关闭</a>
       				    <c:if test="${SWFileDealRight.canClose}">
       				      <a href='#' class='easyui-linkbutton' iconCls='icon-common' onclick="doClose()">阅毕不流转</a>
       				    </c:if>
       				    <c:if test="${SWFileDealRight.canCo}">
       				      <a href='#' class='easyui-linkbutton' iconCls='icon-common' onclick="doCo()">协办</a>
       				    </c:if> 
       				   <c:if test="${SWFileDealRight.reject}">
	       					<a href='#' class='easyui-linkbutton' iconCls='icon-undo' onclick="reject('${fileter.taskId}')">退回</a>
	       				</c:if>
	       				
	       				</td>
       				</tr>
       				<tr><td style="height:5px;"></td></tr>
       				<tr align="right" >
       					<td style="margin-top:8px;">
       					
       					
       					
       					
       				<!-- 父文件有三中情况 -->
       				<!-- 如果有parentFileGuid -->
       				<c:if test="${file.fileKind1 eq 'SendFile'}">
       					<c:if test="${file.parentFileGuid ne '' and (file.parentFileGuid != null)}">
       						<input name="button2" type=button class="btn" onclick="doQuery2('${file.parentFileGuid}','${parentFileKind}')"  value="关联文件详细信息"/>
	       					<input name="button2" type=button class="btn" onclick="doPrint2('${file.parentFileGuid}','${parentFileKind}')" value="关联文件处理单" />
       					</c:if>
       				</c:if>
       				<c:if test="${file.fileKind1 eq 'ReceiveFile'}">
       					<c:if test="${file.parentFileGuid ne '' and (file.parentFileGuid != null)}">
       						<input name="button2" type=button class="btn" onclick="doQuery2('${file.parentFileGuid}','SendFile')"  value="关联文件详细信息"/>
	       					<input name="button2" type=button class="btn" onclick="doPrint2('${file.parentFileGuid}','SendFile')" value="关联文件处理单" />
       					</c:if>
       				</c:if>
       				<!--<c:if test="${file.fileKind1 eq 'SendFile'}">
       					<c:if test="${file.parentFileGuid ne '' and (file.parentFileGuid != null)}">
       						<input name="button2" type=button class="btn" onclick="doQuery2('${file.parentFileGuid}','SignFile')"  value="关联文件详细信息"/>
	       					<input name="button2" type=button class="btn" onclick="doPrint2('${file.parentFileGuid}','SignFile')" value="关联文件处理单" />
       					</c:if>
       				</c:if>
       				-->
       				<!-- end -->
       					
       				<!-- 子文件有3种情况 -->
       				<!-- 公司发文如果有子文件 -->
       				<c:if test="${file.fileKind1 eq 'SendFile'}">
       					<c:if test="${(subFileGuid != null) and subFileGuid ne ''}">
       						<input name="button2" type=button class="btn" onclick="doQuery2('${subFileGuid}','ReceiveFile')"  value="关联文件详细信息"/>
	       					<input name="button2" type=button class="btn" onclick="doPrint2('${subFileGuid}','ReceiveFile')" value="关联文件处理单" />
       					</c:if>
       				</c:if>
       				<c:if test="${file.fileKind1 eq 'ReceiveFile'}">
       					<c:if test="${(subFileGuid != null) and subFileGuid ne ''}">
       						<input name="button2" type=button class="btn" onclick="doQuery2('${subFileGuid}','SendFile')"  value="关联文件详细信息"/>
	       					<input name="button2" type=button class="btn" onclick="doPrint2('${subFileGuid}','SendFile')" value="关联文件处理单" />
       					</c:if>
       				</c:if>
       				<c:if test="${file.fileKind1 eq 'SignFile'}">
       					<c:if test="${(subFileGuid != null) and subFileGuid ne ''}">
       						<input name="button2" type=button class="btn" onclick="doQuery2('${subFileGuid}','SendFile')"  value="关联文件详细信息"/>
	       					<input name="button2" type=button class="btn" onclick="doPrint2('${subFileGuid}','SendFile')" value="关联文件处理单" />
       					</c:if>
       				</c:if>
       				<!-- end -->
       					
       					
       					
       					<c:if test="${SWFileDealRight.toOtherFile}">
       						<a class='easyui-linkbutton' iconCls='icon-common' onclick="doOther('${file.fileKind1}')">转其他文</a>

       					</c:if>
	       				<c:if test="${SWFileDealRight.entrust}">
	       					<a href='#' class='easyui-linkbutton' iconCls='icon-common' onclick="doEntrust()">委托</a>
	       				</c:if>
	       				
	       				<c:if test="${SWFileDealRight.circulation}">
	       					<a href='#' class='easyui-linkbutton' iconCls='icon-common' onclick="doCirculation()">传阅 </a>
	       				</c:if>
       					
       					<c:if test="${SWFileDealRight.deleteProcess}">
       						<a href='#' class='easyui-linkbutton' iconCls='icon-del' onclick="doDelete()">强制删除</a>
       					</c:if>	
       					<c:if test="${SWFileDealRight.canSend}">
       						<a href='#' class='easyui-linkbutton' iconCls='icon-common' onclick="doSend('${file.fileGuid}')">发送</a>
       					</c:if>
       					
	       				<c:if test="${SWFileDealRight.endProcess}">
	       					<a href='#' class='easyui-linkbutton' iconCls='icon-cut' onclick="doEnd()">结束流程</a>
	       				</c:if>	 
       					
	       				</td>
       				</tr>
       			</table>				  
	 		</td>
	      </tr>
	    </table>
	</form>
	</td>
</tr>
</table>
</div>
<br>
</body>
<script type="text/javascript">

function doNext(){
   if(window.confirm("确定要流转吗？")){
	if(validate(document.all.CRFL06,"i-0-")){
		//document.all.CRFL06.action="${listUrl}&efFormEname=CWCRFL05&methodName=doNextWF";
		//document.all.CRFL06.submit();
		var action="${listUrl}&efFormEname=BLANK&methodName=doNextWF";
		submitData("CRFL06",action,"CWCRFL06","fileGuid","","","流转成功!");
	}
	}
}

function doClose(){
   	if(window.confirm("确定要执行吗？")){
		if(validate(document.forms['CRFL06'],"i-0-")){
			var action="${listUrl}&efFormEname=BLANK&methodName=doClose";
			submitData("CRFL06",action,"CWCRFL06","fileGuid","","","执行成功!");
		}
	}
}

function queryWF(fileGuid){
 if(window.confirm("确定要流程跟踪吗？")){
	window.open('${listUrl}&efFormEname=CWCRFLWF&methodName=queryWFList&i-0-fileGuid='+fileGuid+'&temp='+Math.random());
	}
}

function doPrint(fileGuid){
  if(window.confirm("确定要生成订单吗？")){
   //var efFormEname;
	//var fileKind = '${file.fileKind1}';
	//if(fileKind=="SendFile"){
	//	efFormEname='CWCRFLS6';
	//}else if(fileKind=="ReceiveFile"){
	//	efFormEname='CWCRFLR6';
	//}else if(fileKind=="SignFile"){
	//	efFormEname='CWCRFLQ6';
	//}else if(fileKind=="DeptReceiveFile"){
	//	efFormEname='CWCRFLD6';
	//}else if(fileKind=="DeptSendFile"){
	//	efFormEname='CWCRFLM6';
	//}
//	if(!efFormEname){
	//	alert("未指定文种！");
	//	return;
	//}
	var efFormEname;
	var fileKind = '${file.fileKind1}'; 
	var efFormEname = '${efFormEname1}'; 
	if(!efFormEname || efFormEname == ""){
		alert("未指定文种！");
		return;
	}
	window.open('${listUrl}&efFormEname='+efFormEname+'&methodName=queryDetailForm&i-0-fileGuid='+fileGuid+'&temp='+Math.random());
	}
}
function doQuery(fileGuid){
	//var efFormEname;
	//var fileKind = '${file.fileKind1}';
	//if(fileKind=="SendFile"){
	//	efFormEname='CWCRFLS5';
	//}else if(fileKind=="ReceiveFile"){
	//	efFormEname='CWCRFLR4';
	//}else if(fileKind=="SignFile"){
	//	efFormEname='CWCRFLQ5';
	//}else if(fileKind=="CommunicationFile"){
	//	efFormEname='CWCRFLC4';
	//}else if(fileKind=="DeptReceiveFile"){
	//	efFormEname='CWCRFLD4';
	//}else if(fileKind=="DeptSendFile"){
	//	efFormEname='CWCRFLM5';
	//}
	//if(!efFormEname){
	//	alert("未指定文种！");
		//return;
	//}
	//var retValue = window.showModalDialog("${listUrl}&efFormEname="+efFormEname+"&methodName=queryDetailWF&i-0-fileGuid="+fileGuid+"&i-0-taskId="+"${fileter.taskId}"+"&temp="+Math.random(),"","dialogWidth=800px;dialogHeight=600px");
	//if(retValue == undefined){
	//	return;
	//}
	//var fileGuid ="${file.fileGuid}";
	//alert(fileGuid);
	//var taskId ="${fileter.taskId}";
	//alert(taskId);
	
	///document.forms[0].submit();
	//window.location.href="${listUrl}&efFormEname=CWCRFL06&methodName=queryDetailWF&i-0-fileGuid="+fileGuid+"&i-0-taskId="+taskId;
	
	//}
	var efFormEname;
	var fileKind = '${file.fileKind1}'; 
	var efFormEname = '${efFormEname2}'; 
	if(!efFormEname || efFormEname == ""){
		alert("未指定文种！");
		return;
	}
	var taskId='${fileter.taskId}'
	var path = "${listUrl}&efFormEname="+efFormEname+"&methodName=queryDetailWF&i-0-fileGuid="+fileGuid+"&i-0-taskId="+taskId;
	curDialogId=createUI(path,"基本信息",850,450,'',efFormEname);
}

function reject(){
	if(window.confirm("确定要退回吗？")){
		//document.all.CRFL06.action="${listUrl}&efFormEname=CWCRFL05&methodName=queryRjectArchive";
		//document.all.CRFL06.submit();
		var action="${listUrl}&efFormEname=BLANK&methodName=queryRjectArchive";
		submitData("CRFL06",action,"CWCRFL06","fileGuid","","","退回成功!");
	}
}

//取消
function doBack(){
   if(window.confirm("确定要关闭吗？"))
	   closeUI("CWCRFL06");
}

//委托
function doEntrust(){
	if(window.confirm("确定要委托吗？")){
	var myObject = new Object();
	var url ='${ctx}/EFMPX/TREE/USERSEL.jsp?orgLabel=<%=groupLabel%>';
	var rtn = window.showModalDialog(url,myObject,'dialogHeight: 600px; dialogWidth: 800px; dialogTop: 458px; dialogLeft: 166px; edge: Raised; center: Yes; help: Yes; resizable: Yes; status: Yes;');
	if(rtn){
		if(rtn.split(";").length>1){
			alert("只能选择一个用户！");
			return;
		}else{
			var newUserLabel = rtn.split(",")[0];
			if(newUserLabel!=""){
			 if(confirm("确认委托吗？")){
		   // document.all.CRFL06.action="${listUrl}&efFormEname=CWCRFL05&methodName=doEntrust&i-0-newUserLabel="+newUserLabel;
			//document.all.CRFL06.submit();
			 var action="${listUrl}&efFormEname=BLANK&methodName=doEntrust&i-0-newUserLabel="+newUserLabel;
		    submitData("CRFL06",action,"CWCRFL06","fileGuid","","","委托成功!");
		  }else{
		    return;
		  }
			}
			
		}
	}
	}
}

//传阅
function doCirculation(){
	if(window.confirm("确定要传阅吗？")){
	var myObject = new Object();
	var url ='${ctx}/EFMPX/TREE/USERSEL.jsp?orgLabel=<%=groupLabel%>';
	var rtn = window.showModalDialog(url,myObject,'dialogHeight: 600px; dialogWidth: 800px; dialogTop: 458px; dialogLeft: 166px; edge: Raised; center: Yes; help: Yes; resizable: Yes; status: Yes;');
	if(rtn){
		var newUserLabel = "";
		var us = rtn.split(";");
		for(i=0;i<us.length;i++){
			newUserLabel += us[i].split(",")[0] + ",";
		}
		if(newUserLabel!=""){
		  if(confirm("确认传阅吗？")){
		     //document.all.CRFL06.action="${listUrl}&efFormEname=CWCRFL05&methodName=doCirculation&i-0-newUserLabel="+newUserLabel;
		     //document.all.CRFL06.submit();
		     var action="${listUrl}&efFormEname=BLANK&methodName=doCirculation&i-0-newUserLabel="+newUserLabel;
		    submitData("CRFL06",action,"CWCRFL06","fileGuid","","","传阅成功!");
		  }else{
		    return;
		  }
		}
		
	}
	}
}

//协办
function doCo(){
	if(window.confirm("确定要协办吗？")){
	var myObject = new Object();
	var url ='${ctx}/EFMPX/TREE/USERSEL.jsp?orgLabel=<%=groupLabel%>';
	var rtn = window.showModalDialog(url,myObject,'dialogHeight: 600px; dialogWidth: 800px; dialogTop: 458px; dialogLeft: 166px; edge: Raised; center: Yes; help: Yes; resizable: Yes; status: Yes;');
	if(rtn){
		var newUserLabel = "";
		var us = rtn.split(";");
		for(i=0;i<us.length;i++){
			newUserLabel += us[i].split(",")[0] + ",";
		}
		//document.all.CRFL06.action="${listUrl}&efFormEname=CWCRFL05&methodName=doCo&i-0-newUserLabel="+newUserLabel;
		//document.all.CRFL06.submit();
		var action="${listUrl}&efFormEname=BLANK&methodName=doCo&i-0-newUserLabel="+newUserLabel;
		submitData("CRFL06",action,"CWCRFL06","fileGuid","","","协办成功!");
	}
	}
}

//强制删除
function doDelete(){
	if(window.confirm("确定强制删除吗?")){
		//document.all.CRFL06.action="${listUrl}&efFormEname=CWCRFL05&methodName=doDelete&returnMethod=queryTaskList";
		//document.all.CRFL06.submit();
		var action="${listUrl}&efFormEname=BLANK&methodName=doDelete&returnMethod=queryTaskList";
		submitData("CRFL06",action,"CWCRFL06","fileGuid","","","强制删除成功!");
	}
}

//结束流程
function doEnd(){
	if(window.confirm("确定结束流程吗?")){
		//document.all.CRFL06.action="${listUrl}&efFormEname=CWCRFL05&methodName=doEnd&returnMethod=queryTaskList";
		//document.all.CRFL06.submit();
		var action="${listUrl}&efFormEname=BLANK&methodName=doEnd&returnMethod=queryTaskList";
		submitData("CRFL06",action,"CWCRFL06","fileGuid","","","结束流程成功!");
	}
}

//转其他文
function doOther(fileKind){
	if(window.confirm("确定转其他文吗?")){
	var page = window.showModalDialog("${ctx}/CW/CR/other.jsp?fileKind="+fileKind);
	var parentFileGuid = '${file.fileGuid}';
	if(page){
		var efFormEname = page.split(";")[0];
		var fileKind = page.split(";")[1];
		window.open("${ctx}/DispatchAction.do?serviceName=CWCRFile&efFormEname="+efFormEname+"&methodName=queryNew&i-0-fileKind="+fileKind+"&i-0-parentFileGuid="+parentFileGuid);
	}
}
}

function doPrint2(fileGuid,targetfileKind){
   var efFormEname;
	var fileKind = '${file.fileKind1}';
	if(fileKind=="SendFile"){
		efFormEname='CWCRFLS6';
	}else if(fileKind=="ReceiveFile"){
		efFormEname='CWCRFLR6';
	}else if(fileKind=="SignFile"){
		efFormEname='CWCRFLQ6';
	}else if(fileKind=="DeptReceiveFile"){
		efFormEname='CWCRFLD6';
	}else if(fileKind=="DeptSendFile"){
		efFormEname='CWCRFLM6';
	}
	if(!efFormEname){
		alert("未指定文种！");
		return;
	}
	
	var fileKind2 = "";
	if(targetfileKind != undefined){
		fileKind2 = "&fileKind='"+ targetfileKind + "'";
		if(targetfileKind=="SendFile"){
			efFormEname='CWCRFLS6';
		}
		if(targetfileKind == "ReceiveFile"){
			//TODO 修改返回页面
			efFormEname='CWCRFLR6';
		}
		if(targetfileKind == "SignFile"){
			//TODO 修改返回页面
			efFormEname='CWCRFLQ6';
			disabled = "true";
		}
	}
	window.open('${listUrl}&efFormEname='+efFormEname+'&methodName=queryDetailForm&i-0-fileGuid='+fileGuid+'&temp='+Math.random()+fileKind2);
}
function doQuery2(fileGuid,targetFileKind){
	var efFormEname;
	var fileKind = '${file.fileKind1}';
	if(fileKind=="SendFile"){
		efFormEname='CWCRFLS5';
	}else if(fileKind=="ReceiveFile"){
		efFormEname='CWCRFLR4';
	}else if(fileKind=="SignFile"){
		efFormEname='CWCRFLQ5';
	}else if(fileKind=="CommunicationFile"){
		efFormEname='CWCRFLC4';
	}else if(fileKind=="DeptReceiveFile"){
		efFormEname='CWCRFLD4';
	}else if(fileKind=="DeptSendFile"){
		efFormEname='CWCRFLM5';
	}
	if(!efFormEname){
		alert("未指定文种！");
		return;
	}
	var fileKind2 = "";
	var efFormEname2 = efFormEname;
	var disabled = "false";
	if(targetFileKind != undefined){
		fileKind2 = "&fileKind='"+ targetFileKind + "'";
		if(targetFileKind == "SendFile"){
			efFormEname='CWCRFLS4';
			disabled = "true";
		}
		if(targetFileKind == "ReceiveFile"){
			//TODO 修改返回页面
			efFormEname='CWCRFLR4';
			disabled = "true";
		}
		if(targetFileKind == "SignFile"){
			//TODO 修改返回页面
			efFormEname='CWCRFLQ4';
			disabled = "true";
		}
	}
	var retValue = window.showModalDialog("${listUrl}&efFormEname="+efFormEname+"&methodName=queryDetailWF&i-0-fileGuid="+fileGuid+"&i-0-taskId="+"${fileter.taskId}"+"&temp="+Math.random()+fileKind2+"&disabled="+disabled,"","dialogWidth=800px;dialogHeight=600px");
	if(retValue == undefined){
		return;
	}
	if(targetFileKind != null && targetFileKind != ""){
		return;
	}
	var fileGuid ="${file.fileGuid}";
	var taskId ="${fileter.taskId}";
	var efFormEname = efFormEname2;
	window.open("${listUrl}&efFormEname=CWCRFL06&methodName=queryDetailWF&i-0-fileGuid="+fileGuid+"&i-0-taskId="+taskId);
}

function doSend(fileGuid){
	if(window.confirm("确定要放送吗？")){
	var efFormEname;
	var fileKind = '${file.fileKind1}';
	if(fileKind=="SendFile"){
		efFormEname='CWCRFLS7';
	}else if(fileKind=="DeptSendFile"){
		efFormEname='CWCRFLS7';
	}
	if(!efFormEname){
		alert("未指定文件类型！");
		return;
	}
	// document.all.forms.action="${listUrl}&efFormEname="+efFormEname+"&methodName=queryDetail&i-0-fileGuid="+fileGuid;
	// document.all.forms.submit();
	var path = "${listUrl}&efFormEname="+efFormEname+"&methodName=queryDetailBySend&i-0-fileGuid="+fileGuid;
	createUI(path,"发送公文",850,450,'',efFormEname);
	}
}
</script>
